import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main1(String[] args) {
        System.out.println("haha");
//        int a = 10;
//        long b = 20;
//        int c = (int)(a + b);
//        int d = a + b;
//        float f = 12.7f;
//        int e = f;
        byte  b1 = 12;
        byte  b2 = 23;
        byte  b3 = (byte)(b1 + b2);

    }

    public static void main2(String[] args) {
        String str = "hello";
        System.out.println(str);
        int a = 100;
        System.out.println(a);
        //此时的str和a都是局部变量,此时都存放在栈上
    }

    public static void main3(String[] args) {
        String str1 = "hello";
        String str2 = "world";
        System.out.println(str1 + str2);
        //在字符串当中,如果两个字符串进行相加,那么就是拼接两个字符串

        int a = 10;
        int b = 20;
        System.out.println("a+b = " + a + b);
        System.out.println(a+b+"=a+b");
    }

    public static void main4(String[] args) {
        int a = 12345;
        String ret1 = String.valueOf(a);
        double d = 12.4;
        String ret2 = String.valueOf(d);
        String ret3 = d + "";//投机取巧的小方法

        String str = "12345";

        String str2 = "12.4";
        double d2 = Double.valueOf(str2);

        int b = Integer.valueOf(str);
        b = Integer.parseInt(str);
    }

    public static void main5(String[] args) {
//        System.out.println(5/2);  // 2
//        System.out.println((float)5/2); // 2.5
//        System.out.println(5/(float)2); // 2.5
//        System.out.println((float)(5/2));// 2.0
//
//        System.out.println(10%3);  // 1
//        System.out.println(10%-3); // 1
//        System.out.println(-10%3); // -1
//        System.out.println(-10%-3);// -1
//
//        System.out.println(11.5%2);  // 1.5
//        System.out.println();

        short sh = 12;
        sh += 2; // 复合运算符会自动进行类型转换
//        sh = sh + 2;

//        sh = sh++;  奇怪
//
//        System.out.println(sh);
//
//        System.out.println( 100 >  199 > 12);

        int a = 1;
        int b = 2;
        int c = 0;
        //System.out.println(b / c == 0);
        System.out.println(a == 2 && b/c == 0);
        System.out.println(a == 1 ||  b/c == 0);
    }

    public static void main7(String[] args) {
        int a = -2;
        System.out.println(a >> 2);
        System.out.println(-1 >>> 1); // 正数的最大值
        System.out.println(-1 << 1);

    }

    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        binaryTree.create();
        System.out.println(binaryTree.find2(binaryTree.root, 'B').val);

    }

}
